package com.zzr.zzrbackend.controller;

import com.zzr.zzrbackend.pojo.domain.ReviseEmergePersonParam;
import com.zzr.zzrbackend.pojo.dto.CommonResult;
import com.zzr.zzrbackend.pojo.dto.param.DeleteEmergePersonParam;
import com.zzr.zzrbackend.pojo.dto.param.EmergePersonParam;
import com.zzr.zzrbackend.pojo.dto.result.*;
import com.zzr.zzrbackend.service.MyInterfaceService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;


@RestController
public class MyInterfaceController {
    @Resource
    MyInterfaceService myInterfaceService;

    @PostMapping("/api/my-interface/child")
    public CommonResult<ChildInterfaceResult> childHome() {
        return myInterfaceService.childHome();
    }

    @PostMapping("/api/my-interface/parent")
    public CommonResult<ParentAndVolunteerFaceResult> parentHome() {
        return myInterfaceService.parentHome();
    }

    @PostMapping("/api/my-interface/volunteer")
    public CommonResult<ParentAndVolunteerFaceResult> volunteerHome() {
        return myInterfaceService.volunteerHome();
    }

    @PostMapping("/api/my-profile/child")
    public CommonResult<ChildProfileResult> childProfile() {
        return myInterfaceService.childProfile();
    }

    @PostMapping("/api/my-profile/parent")
    public CommonResult<ParentProfileResult> parentProfile() {
        return myInterfaceService.parentProfile();
    }

    @RequestMapping(value = "/api/my-profile/volunteer",method = RequestMethod.GET)
    public CommonResult<VolunteerProfileResult> getVolunteerProfile(HttpServletRequest request) {
        return myInterfaceService.getVolunteerProfile(request);
    }

    @RequestMapping(value = "/api/my-profile/volunteer",method = RequestMethod.POST)
    public CommonResult<NoData> setVolunteerProfile(HttpServletRequest request, @RequestBody VolunteerProfileResult volunteerProfileResult) {
        return myInterfaceService.setVolunteerProfile(request,volunteerProfileResult);
    }

    @PostMapping("/api/set/emerge-person")
    public CommonResult<NoData> setEmergePerson(@RequestBody EmergePersonParam emergePersonParam) {
        return myInterfaceService.setEmergePerson(emergePersonParam);
    }

    @PostMapping("/api/revise/emerge-person")
    public CommonResult<NoData> reviseEmergePerson(@RequestBody ReviseEmergePersonParam reviseEmergePersonParam) {
        return myInterfaceService.reviseEmergePerson(reviseEmergePersonParam);
    }

    @PostMapping("/api/get/emerge-person")
    public CommonResult<EmergePersonResult> getEmergePerson() {
        return myInterfaceService.getEmergePerson();
    }

    @PostMapping("/api/delete/emerge-person")
    public CommonResult<NoData> deleteEmergePerson(@RequestBody DeleteEmergePersonParam deleteEmergePersonParam) {
        return myInterfaceService.deleteEmergePerson(deleteEmergePersonParam);
    }

}
